import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DiskWorkVO, DiskWorkForm, DiskWorkQuery } from '@/api/system/diskWork/types';

/**
 * 查询盲板抽堵作业列表
 * @param query
 * @returns {*}
 */

export const listDiskWork = (query?: DiskWorkQuery): AxiosPromise<DiskWorkVO[]> => {
  return request({
    url: '/system/diskWork/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询盲板抽堵作业详细
 * @param id
 */
export const getDiskWork = (id: string | number): AxiosPromise<DiskWorkVO> => {
  return request({
    url: '/system/diskWork/' + id,
    method: 'get'
  });
};

/**
 * 新增盲板抽堵作业
 * @param data
 */
export const addDiskWork = (data: DiskWorkForm) => {
  return request({
    url: '/system/diskWork',
    method: 'post',
    data: data
  });
};

/**
 * 修改盲板抽堵作业
 * @param data
 */
export const updateDiskWork = (data: DiskWorkForm) => {
  return request({
    url: '/system/diskWork',
    method: 'put',
    data: data
  });
};

/**
 * 删除盲板抽堵作业
 * @param id
 */
export const delDiskWork = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/diskWork/' + id,
    method: 'delete'
  });
};
